package com.lmx.repoDomain.repository;

import java.util.Map;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.lmx.common.util.CommonUtil;
import com.lmx.persistence.service.DrugPlanExeRecordService;
import com.lmx.repoDomain.tmodel.unpersis.DrugPlanExeRecord;

import io.katharsis.queryParams.QueryParams;
import io.katharsis.repository.annotations.JsonApiFindAll;
import io.katharsis.repository.annotations.JsonApiResourceRepository;

/**
 * 用药计划统计
 *
 * @author ytche
 * @date 2017年7月27日
 *
 */
@JsonApiResourceRepository(DrugPlanExeRecord.class)
@Component
public class DrugPlanExeRecordRepository extends
		BaseRepository<DrugPlanExeRecord> {
	@PostConstruct
	public void init() {
		super.dslJpaService.setEntityClass(DrugPlanExeRecord.class);
	}

	@Autowired
	DrugPlanExeRecordService service;

	@Override
	@JsonApiFindAll
	public Iterable<DrugPlanExeRecord> findAll(final QueryParams requestParams) {
		Map<String, String> filter = CommonUtil
				.getKeyMapByFilter(requestParams);
		return service.findAll(filter);
	}
}
